package com.mingqi.enetconnected.primary.mytask.adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mingqi.enetconnected.R;
import com.mingqi.enetconnected.view.Dialog.AddTroubleDialog;
import com.mingqi.enetconnected.view.Dialog.CheckTroubleDialog;

import java.util.List;

/**
 * @author li
 * @version 1.0
 * @describe
 * @WeChat 18571658038
 * @date 2018/9/7 星期五.
 */

public class HistoryTroubleAdapter extends BaseQuickAdapter<String,BaseViewHolder> {

    public HistoryTroubleAdapter(@Nullable List<String> data) {
        super(R.layout.item_history_trouble,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {

        helper.addOnClickListener(R.id.tv_trouble_remark);

        helper.getView(R.id.tv_change).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                AddTroubleDialog dialog = new AddTroubleDialog(mContext);
                dialog.show();
            }
        });

        helper.getView(R.id.tv_check).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                CheckTroubleDialog dialog = new CheckTroubleDialog(mContext);
                dialog.show();
            }
        });
    }
}
